package c03.thread.api.run;

import util.FileReader;
import util.Constants;
import lombok.extern.slf4j.Slf4j;

@Slf4j(topic = "c.IOThreadDemo")
public class ThreadRunTest {

    public static void main(String[] args) {
        Thread t1 = new Thread("t1") {
            @Override
            public void run() {
                log.debug("running...");
                FileReader.read(Constants.VIDEO_PATH);
            }
        };

        t1.run(); // 调用run方法会直接由main线程执行而不是开启一个新的t1线程去执行
        log.debug("do other things...");
    }
}
